﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMSModel;

public partial class news_EditFirst : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            CMSModel.CMSEntities dal = DAL.DBManager.GetCmsEmtity();
            var c = dal.HeadlinePage.Where(x => x.PageId == PageId).First();
            lblModuleName.Text = c.Name;
            DataList1.DataSource = dal.HeadlineContent.Where(x=>x.PageId==PageId);
            DataList1.DataBind();
            
        }
    }
    public string PageId
    {
        get
        {
            if (ViewState["PageId"] == null)
            {
                return string.Empty;
            }
            else
            {
                return ViewState["PageId"].ToString();
            }
        }
        set
        {
            ViewState["PageId"] = value;
        }
    }
}